{% extends 'base.html' %}
{% block title %}
    <title>地址管理</title>
{% endblock %}
{% block container %}
    <!-- 主体 start -->
    <header class="wy-header">
        <div class="wy-header-icon-back"><span></span></div>
        <div class="wy-header-title">地址管理</div>
    </header>
    <div class="weui-content">
        <div class="weui-panel address-box">
            {% for item in my_addr_list %}
                <div class="weui-panel__bd">
                    <div class="weui-media-box weui-media-box_text address-list-box">
                        <a href="{% url 'accounts:address_edit'  item.id %}" class="address-edit"></a>
                        <h4 class="weui-media-box__title">
                            <span>{{ item.username }}</span>
                            <span>{{ item.get_phone_format }}</span>
                        </h4>
                        <p class="weui-media-box__desc address-txt">
                            {{ item.get_region_format }}
                            {{ item.address }}
                        </p>
                        {% if item.is_default %}
                            <span class="default-add">默认地址</span>
                        {% endif %}
                    </div>
                </div>
            {% endfor %}
        </div>
        <div class="weui-btn-area">
            <a class="weui-btn weui-btn_primary"
               href="{% url 'accounts:address_edit' 'add' %}" id="showTooltips">添加收货地址</a>
        </div>
    </div>
    <!-- 主体 end -->
{% endblock %}

{% block footer %}
    <script type="text/javascript" src="/static/js/jquery.Spinner.js"></script>
{% endblock %}
